﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace HelloWPF.DataBinding
{
    public class Control : FrameworkElement
    {
        public string Value { get; set; }

        //依赖属性：
        //1.可以被绑定
        //2.可以变化通知
        public int MyProperty
        {
            get { return (int)GetValue(MyPropertyProperty); }
            set
            {
                SetValue(MyPropertyProperty, value);
            }
        }

        public static readonly DependencyProperty MyPropertyProperty =
            DependencyProperty.Register("MyProperty", typeof(int), typeof(Control), new PropertyMetadata(0));
    }
}
